<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            position: relative;
        }
        label {
            position: absolute;
            top: 5px;
            right: 100px;
            font-size: 20px;
            border: 1px solid #aaa;
        }
    </style>
</head>
<body>
    <div class="box">
        <img src="images/logo.png" alt="">
        <label for="">×</label>
    </div>
    <script>
        //要求点击×号可以关闭广告
        var label = document.querySelector('label');
        var box = document.querySelector('.box');
        // 注册事件
        label.onclick = function() {
            box.style.display = 'none';
        }
    </script>
</body>
</html>